home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 4327 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.5 KB

  1. Path: nntp.teleport.com!sschaem
  2. From: sschaem@teleport.com (Stephan Schaem)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: TMapping again!
  5. Date: 27 Feb 1996 15:41:56 GMT
  6. Organization: Teleport - Portland's Public Access (503) 220-1016
  7. Distribution: world
  8. Message-ID: <4gv8o4$hft@maureen.teleport.com>
  9. References: <38232527@kone.fipnet.fi> <4gkrht$d5l@maureen.teleport.com> <38232665@kone.fipnet.fi>
  10. NNTP-Posting-Host: julie.teleport.com
  11. X-Newsreader: TIN [version 1.2 PL2]
  12.  
  13. Jyrki Saarinen (jsaarinen@kone.fipnet.fi) wrote:
  14.  
  15. : >  a mul?.w is 27, a muls.l is 43
  16. : >  a divs.l is 90
  17.  
  18. : Max. 90.. How about if the low word is zero? I think the
  19. : amount of bits on influences the speed of a divide.
  20.  
  21.  I remember the 68000 taking -+10% for the div count... max was a
  22.  few hundreds cycle I think :)
  23.  But the mul cycle too can fluctuate, I will check on a 68030.
  24.  
  25. : > -- what you do with muls.l is:
  26. : > 
  27. : > setup
  28. : >         move.l  (a2,d0.w*4),d1  ;done upto 4 time per poly
  29. : > 
  30. : > opp:
  31. : >     ext.l    d2
  32. : >         muls.l  d1,d2         ; 2+43 * upto 15time = 675
  33. : > 
  34. : > 
  35. : > -- with div:
  36. : > 
  37. : > setup
  38. : >         ext.l   d0        ; done upto 4 time per poly
  39. : > 
  40. : > opp:
  41. : >         swap    d2
  42. : >         sub.w   d2,d2
  43. : >     divs.l    d2,d0         ;4+2+90 * 15 = 1440
  44.  
  45. : Yep, but the point is that my values are readily shifted
  46. : to high word, and if I want to use muls.l 1/x table with 16.16,
  47. : I have to clear the upper word, too.
  48.  
  49.  I think I added 2 cycle for that, the ext.l...
  50.  
  51. : >  You dont have to fall back to 15bit precision to gain the speed
  52. : >  from mul VS div... using 15bit give you an extra 6.03 mcycle, or
  53. : >  you could use mulu.w and adjust the sign?
  54.  
  55. : Adjusting the sign .. naah..
  56.  
  57.  You can do ALOT in 90cycles :)
  58.  
  59. : >  Myself I will stick with 16:16 and muls.l on 68030 and under.
  60. : >  a divs.l is ~2time slower then a muls.l and ~3.5 slower then a muls.w
  61. : >  On a 68000 I would go with 15bit and muls + an add.l: 76 cycle... ouch
  62. : >  but still less then a divs.l on a 030 ;) (To bad the 68000 mhz is so
  63. : >  limited:)
  64.  
  65. : A divide table would be the best in my case.. 512kB for a table.
  66. : Oh yes, muls.w 15bit table and the add.l dx,dx.. quite clever..
  67.  
  68.  I'm curently using a 4K table for slope, 32K table for projection.
  69.  But thats still all in C, I'm not 100% sure how all this will
  70.  actually turn out.
  71.  
  72. : But I still dont get your point; the divides dont matter
  73. : very much in the frame rate..
  74.  
  75.  In the case of doom or so... complex pixel and huge polygon its
  76.  so minimal it doesn't matter. But if you add polygonal player
  77.  in that scene the polygon count jump. 
  78.  
  79.  Stephan
  80.